#!/bin/bash
file_path="logtemp.txt"
declare -a user_input_list=(
    "item one"
    "item two"
)

function nmcli_log() {
    echo -e "\n--- LOG START ---" >> "$file_path"
    printf "%s    " "$@" >> "$file_path"
    echo -e "\n--- LOG END: Completed at $(date +"%Y-%m-%d %H:%M:%S") ---" >> "$file_path"
}

nmcli_log ${user_input_list[@]}